<?php
// no direct access
defined('_JEXEC') or die ('Restricted access');
$doc =& JFactory::getDocument();
$doc->addStyleDeclaration('#rt-showcase .rt-block {height:'.($params->get('image_height')+10).'px; border-top:10px solid #fff;} .navigation-container-custom {bottom:95px !important;}');

$getapps= & JFactory::getApplication();
$bpath = JURI::base();
$template = $getapps->getTemplate();

?>

	<div id="djslider-loader<?php echo $mid; ?>" class="djslider-loader" style="position:absolute; width:<?php echo $params->get('image_width') ?>px; height:<?php echo $params->get('image_height') ?>px; top:0; left:50%; margin-left:-<?php echo $params->get('image_width')/2 ?>px; background: url(<?php echo $bpath.'/templates/'.$template; ?>/images/ajax-loader.gif) center center no-repeat; ">
    <div id="djslider<?php echo $mid; ?>" class="djslider">
        <div id="slider-container<?php echo $mid; ?>" class="slider-container">
        	<ul id="slider<?php echo $mid; ?>">
          		<?php
				$i = 1;
				foreach ($slides as $slide) {
					$titlu_culoare = explode('||',$slide->title);
					$titlu = $titlu_culoare[0];
					$culoare = $titlu_culoare[1];
					?>
          			<li id="slide<?php echo $i++; ?>" value="<?php echo $culoare; ?>"> 
            			<?php if (($slide->link && $params->get('link_image',1)==1) || $params->get('link_image',1)==2) { ?>
							<a <?php echo ($params->get('link_image',1)==2 ? 'class="modal"' : ''); ?> href="<?php echo ($params->get('link_image',1)==2 ? $slide->image : $slide->link); ?>" target="<?php echo $slide->target; ?>">
						<?php } ?>
							<img src="<?php echo $slide->image; ?>" alt="<?php echo $slide->alt; ?>" />
						<?php if (($slide->link && $params->get('link_image',1)==1) || $params->get('link_image',1)==2) { ?>
							</a>
						<?php } ?>
						
						<?php if($params->get('slider_source') && ($params->get('show_title') || ($params->get('show_desc') && !empty($slide->description)))) { ?>
						<div class="slide-desc">
						  <div class="slide-desc-in">	
							<div class="slide-desc-text">
							<?php if($params->get('show_title')) { ?>
								<div class="slide-title">
									<?php if($params->get('link_title') && $slide->link) { ?><a href="<?php echo $slide->link; ?>" target="<?php echo $slide->target; ?>"><?php } ?>
										<?php echo $titlu; ?>
									<?php if($params->get('link_title') && $slide->link) { ?></a><?php } ?>
								</div>
							<?php } ?>
							
							<?php if($params->get('show_desc')) { ?>
							<?php if($params->get('link_desc') && $slide->link) { ?><a href="<?php echo $slide->link; ?>" target="<?php echo $slide->target; ?>"><?php } ?>
								<?php echo $slide->description; ?>
							<?php if($params->get('link_desc') && $slide->link) { ?></a><?php } ?>
							<?php } ?>
							
							<?php if($params->get('show_readmore') && $slide->link) { ?>
								<div style="clear: both"></div>
								<a href="<?php echo $slide->link; ?>" target="<?php echo $slide->target; ?>" class="readmore"><?php echo JText::_('Readmore'); ?></a>
							<?php } ?>
							<div style="clear: both"></div>
							</div>
						  </div>
						</div>
						<?php } ?>						
						
					</li>
                <?php } ?>
        	</ul>
        </div>
        <div id="navigation<?php echo $mid; ?>" class="navigation-container">
			<div id="play<?php echo $mid; ?>" class="play-button"></div>
			<div id="pause<?php echo $mid; ?>" class="pause-button"></div>
        </div>
        <?php
		$width = count($slides)*16;
		$style = '-'.($width/2).'px';
		?>
		<div id="cust-navigation<?php echo $mid; ?>" class="navigation-container-custom" style="margin-left:<?php echo $style; ?>"> 
			<?php $i = 0; foreach ($slides as $slide) { ?>
				<span class="load-button<?php if ($i == 0) echo ' load-button-active'; ?>"></span>
			<?php if(count($slides) == $i + $count) break; else $i++; }
			//echo ;
			 ?>
        </div>
    </div>
        <div class="buttonsNav">
            <div id="prev<?php echo $mid; ?>" class="prev-button"></div>
            <div id="next<?php echo $mid; ?>" class="next-button"></div>
        </div>
	</div>
	
	<div style="clear: both"></div>